/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author Cheng
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '/@/api/model/baseModel';

const { adminPath } = useGlobSetting();

export interface InMaintenanceInfoData extends BasicModel<InMaintenanceInfoData> {
  maintenanceId?: number; // 维保任务ID
  createTime?: string; // 添加时间
  updateTime?: string; // 更新时间
  firstDetectionTime?: string; // 首次完成检测时间
  equipmentId?: string; // 设备ID
  state?: string; // 状态（01: 未检测, 10: 已检测）
  equipmentType?: string; // 设备类型名称
  equipmentTypeCode?: string; // 设备类型编码
  equipmentCode?: string; // 设备编码
  equipmentAddress?: string; // 设备地址
  equipmentName?: string; // 设备名称
  executeTime?: string; // 执行时间（年/月）
  mark?: string; // 备注信息
  enterpriseId?:string; // 企业ID
}

export const inMaintenanceInfoDataList = (params?: InMaintenanceInfoData | any) =>
  defHttp.get<InMaintenanceInfoData>({ url: adminPath + '/maintenance/management/inMaintenanceInfoData/list', params });

export const inMaintenanceInfoDataListData = (params?: InMaintenanceInfoData | any) =>
  defHttp.post<Page<InMaintenanceInfoData>>({ url: adminPath + '/maintenance/management/inMaintenanceInfoData/listData', params });

export const inMaintenanceInfoDataForm = (params?: InMaintenanceInfoData | any) =>
  defHttp.get<InMaintenanceInfoData>({ url: adminPath + '/maintenance/management/inMaintenanceInfoData/form', params });

export const inMaintenanceInfoDataSave = (params?: any, data?: InMaintenanceInfoData | any) =>
  defHttp.postJson<InMaintenanceInfoData>({ url: adminPath + '/maintenance/management/inMaintenanceInfoData/save', params, data });

export const inMaintenanceInfoDataDelete = (params?: InMaintenanceInfoData | any) =>
  defHttp.get<InMaintenanceInfoData>({ url: adminPath + '/maintenance/management/inMaintenanceInfoData/delete', params });

export const getCompletionStatus = (params?: InMaintenanceInfoData | any) =>
  defHttp.get<Page<InMaintenanceInfoData>>({ url: adminPath + '/maintenance/management/inMaintenanceInfoData/getCompletionStatus', params });

export const getEquipmentTotalByType = (params?: InMaintenanceInfoData | any) =>
  defHttp.get<Page<InMaintenanceInfoData>>({ url: adminPath + '/maintenance/management/inMaintenanceInfoData/getEquipmentTotalByType', params });

export const synchronizerEquipmentData = (params?: InMaintenanceInfoData | any,data?: InMaintenanceInfoData | any) =>
  defHttp.get<Page<InMaintenanceInfoData>>({ url: adminPath + '/maintenance/management/inMaintenanceInfoData/synchronizer', params,data });

export const getEquipmentTotalByMonth = (params?: InMaintenanceInfoData | any) =>
  defHttp.get<Page<InMaintenanceInfoData>>({ url: adminPath + '/maintenance/management/inMaintenanceInfo/monthlyStatus', params });


export const inMaintenanceInfoData = (params?: InMaintenanceInfoData | any) =>
  defHttp.get<Page<InMaintenanceInfoData>>({ url: adminPath + '/maintenance/management/inMaintenanceInfoData/monthlyStatusDetails', params });
